package android.slc.module.sys.ui.welcome

import android.slc.base.ui.AppView
import android.slc.box.core.notification.NotificationObserver
import android.slc.module.project.ui.crawler.CrawlerView

/**
 * @author slc
 * @date 2023/8/24
 **/
class WelcomeView : AppView<WelcomeVm>() {

    override fun onRegisterLiveEvent() {
        super.onRegisterLiveEvent()
        this.viewModel.subscribe(WelcomeVm.EVENT_SWITCH_2_MAIN, NotificationObserver { _, _ ->
            this@WelcomeView.switchView(CrawlerView::class.java)
        })

        this.viewModel.subscribe(WelcomeVm.EVENT_SWITCH_2_LOGIN, NotificationObserver { _, _ ->
            this@WelcomeView.switchView(CrawlerView::class.java)
        })
    }

    override fun onBindViewLater() {
        super.onBindViewLater()
        viewModel.initVm()
    }
}